import numpy as np
import seaborn
import matplotlib
print(matplotlib.__version__)
print(seaborn.__version__)

"""
中文字体设置画图
x = np.array([1, 2, 3, 4, 5, 6])
y = np.array([6, 7, 8, 9, 10, 14])
zhfont1 = matplotlib.font_manager.FontProperties(fname = 'SourceHanSansSC-Bold (3).otf' )
font1 = {'color': 'blue', 'size': 28}
plt.title('Title得到ve',fontproperties=zhfont1,fontdict = font1)
plt.xlabel('X宽度',fontproperties=zhfont1)
plt.ylabel('Y高度',fontproperties=zhfont1)
plt.grid(axis= 'y' ,color ='r' ,linewidth = '0.5',linestyle = '--')
plt.show()
x2 = [3,4,5,6,7,8]
y2 = [12,23,34,45,56,34]
plt.plot(x2,y2)

"""


# x = np.linspace(0 , 2*np.pi ,400 )
# y = np.sin(x*2)
# fig , ax = plt.subplots()
# ax.plot(x, y)
# ax.set_title('simple_plot')

# f,(ax1 , ax2 ) = plt.subplots(1,2,sharey  = True)
# ax1.plot(x,y)
# ax1.set_title('Shatey2')
# ax2.scatter(x,y)

# fig, axs = plt.subplots(2, 2, subplot_kw=dict(projection="polar"))
# axs[0, 0].plot(x, y)
# axs[1, 1].scatter(x, y)
# plt.subplots(2, 2, sharex='col')
# plt.subplots(2, 2, sharey='row')
# plt.subplots(2, 2, sharex='all', sharey='all')
# plt.subplots(2, 2, sharex=True, sharey=True)
# fig, ax = plt.subplots(num=10, clear=True)
# plt.show()


# x = np.array([12, 34, 5, 6, 23, 45, 56, 23])
# y = np.array([23, 45, 56, 56, 34, 23, 34, 34])
# sizes = np.array([230, 34, 45, 56, 67, 12, 23, 34])
# # plt.scatter(x , y , s = sizes,c = colors)
# colors = np.array(["red", "green", "black", "orange", "purple", "beige", "cyan", "magenta"])
# cc = plt.scatter(x, y, s=sizes, c=colors)
#
# plt.imsave('sjf.png',)
#
# # 创建一个二维的图像数据
# img_data = np.random.random((100, 100))

# 显示图像
# plt.imshow(img_data)
#
# # 保存图像到磁盘上
# plt.imsave('runoob-test.png', img_data)
# import matplotlib as mpl
# import matplotlib.pyplot as plt

# # 中文字体设置
# mpl.rcParams["font.family"] = "SimHei"
# # 字体大小设置
# mpl.rcParams["font.size"] = 16
# # 字体风格设置
# mpl.rcParams["font.style"] = "italic"
#
# plt.plot([-3, -2], [-1, -5], "r--")
# plt.title("我是中文-标题")
# plt.show()
# import pandas as pd
# import dataframe_image as dfi
#
# df = pd.read_csv('/Users/user/PycharmProjects'
#                  '/text1/NPI/Export-ID-115213036005725-2023-09-30T04_00_00-2023-10-01T14_00_00-D94-AE-80-KND-04'
#                  '.22-NN.NN-NN.NN-03.03.csv', header = 1 , skiprows=[2,3,4,5,6,7])
# # dfi.export(df , filename= 'cctv.png' ,max_cols= -1 ,max_rows=-1,table_conversion= 'matplotlib' ,fontsize= 24)
#
# print(df.set_option('display.max_columns', None))
#
# import pandas as pd
#
# df ={'姓名':[' 黄同学','黄至尊','黄老邪 ','陈大美','孙尚香'],
#      '英文名':['Huang tong_xue','huang zhi_zun','Huang Lao_xie','Chen Da_mei','sun shang_xiang'],
#      '性别':['男','women','men','女','男'],
#      '身份证':['463895200003128433','429475199912122345','420934199110102311','431085200005230122','420953199509082345'],
#      '身高':['mid:175_good','low:165_bad','low:159_bad','high:180_verygood','low:172_bad'],
#      '家庭住址':['湖北广水','河南信阳','广西桂林','湖北孝感','广东广州'],
#      '电话号码':['13434813546','19748672895','16728613064','14561586431','19384683910'],
#      '收入':['1.1万','8.5千','0.9万','6.5千','2.0万']}
# df = pd.DataFrame(df)
#
# df['xingming+zhuzhi'] = df['姓名'].str.cat(df['家庭住址'],sep = '-'*3)
# print(df.columns)
# print(df)
# l = df['姓名'].str.contains('黄').tolist()
# print(df['姓名'].str.startswith('黄'))
# print(df['英文名'].str.endswith('e'))
# print (df['电话号码'].str.count('4'))
# print(df['姓名'].str.get(-2))
# print(df['身高'].str.split("_").str.get(1))
# print(df['身高'].str.len())
# print(df['英文名'].str.upper())
# print(df['英文名'].str.lower())
# print(df['英文名'].str.center(10,fillchar = '*' ))
# print(df['性别'].str.repeat(5))
# print(df['电话号码'].str.replace(0,'df'))
#
# df[['shengaomiaoshu' , 'filshngao']] = df['身高'].str.split(':' , expand = True)
# print(df)
# print('kais')
import pandas
# x = np.arange(1,13)
# y = np.array([1233,7324,234,1234,245,654,867,255,454,565,345,767])
# plt.plot(x, y , 'ro-' , label  = '每月工资')
# plt.title('张三',fontproperties=zhfont1,fontdict = font1)
# plt.xlabel('月份',fontproperties=zhfont1,fontdict = font1)
# plt.ylabel('工资',fontproperties=zhfont1,fontdict = font1)
# plt.legend(loc = "best")
# for x ,y in zip(x ,y ):
#     plt.text(x,y ,y , ha = 'center' , va = 'bottom' ,fontsize = 10)
# plt.show()
# import re
#
# text = "LXSZ_B02-3FA-14_2_BATTERY-AND-VHB-INSTALL"
#
# pattern = r"[A-Z0-9]+-[A-Z0-9]+-[A-Z0-9_]+"
#
# result = re.findall(pattern, text)
#
# print(result)
